<h2> Properties Uploaded </h2>
<hr>

<div>
	<?php
		if($this->msg){
	?>		
	<div id="msg" class="ui-state-highlight">
		<?php
			 echo $this->msg;
		?>
	</div>
	<?php
		}
		else  if($this->property){ 
		
			
	?>
		<div id="warpaccordion">
		<div id="accordion">
		<?php 
			$property = $this->property;
			foreach($property as $key => $value){
				echo '<h3><a class="title" href="#">'.$value["estate_id"].' for'.$value["estate_for"] .'</a></h3>';
				echo '<div class="ui-widget ui-corner-all">';
				echo '<p>';
				if($value["property_name"]){
					echo '<b>Property Name: </b>'.$value["property_name"].'<br />';
				}
				echo '<b>Category: </b>'.$value["category_id"].'<br />';
				echo '<b>Type: </b>'.$value["type_id"].'<br />';
				if($value["type_id"] == 'flat' || $value["type_id"] == 'FLAT'){
					echo '<b>BHK: </b>'.$value["bhk"].'<br />';
				}
				echo '<b>Size: </b>'.$value["size"].' sq. ft.<br />';
				echo '<b>Price: </b>'.$value["rate_per_unit"]*$value["size"].' INR <br />';
				echo '<b>Address: </b>'.$value["location"].', '.$value["city"];
				if($value["district"])
					echo ', '.$value["district"];
				if($value["state"])	
					echo ', '.$value["state"].'<br />';
				if($value["summary"])	
					echo '<b>Summary: </b>'.$value["summary"];
				echo '</p>';
				echo '</div>';
			} 
		?>
		</div><!-- End accordion -->
	</div><!-- End warpaccordion -->
	<?php
		} 
	?>
	
</div>

<script type="text/javascript">
$(function() {
	$( "#accordion" ).accordion();
});
</script>
<style>
.title{
	color:gray;
}
</style>